<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>线性渐变</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            border: 10px solid gray;
            background: linear-gradient(180deg,red,green,yellow)
            /* 1.
            1.支持多颜色渐变
            2.支持方向，to left， ...，to bottom right，...
            3.支持任意角度的写法 deg角度
            */
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>